package com.atguigu.bean;

import com.atguigu.utils.DateFormatUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.flink.streaming.api.windowing.windows.TimeWindow;
import org.apache.flink.util.Collector;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SttEdtTs2 {
    String Stt;
    String Edt;
    Long ts;
    public static void  getSttEdtTs(SttEdtTs2 next, TimeWindow window, Collector<Object> out) {//SttEdtTs为父类，可以传它的子类，如UserLoginBean4
        next.setTs(System.currentTimeMillis());
        next.setStt(DateFormatUtil.toYmdHms(window.getStart()));
        next.setEdt(DateFormatUtil.toYmdHms(window.getEnd()));
        out.collect(next);
    }
}
